package cn.zl.ymcc.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * <p>
 *
 * </p>
 *
 * @author zl
 * @since 2025-10-16
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("t_department")
public class Department implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 部门编号
     */
    @TableField("sn")
    @NotEmpty(message = "部门编号不能为空")
    private String sn;

    /**
     * 部门名称
     */
    @TableField("name")
    @NotEmpty(message = "部门名称不能为空")
    private String name;

    /**
     * 部门的上级分类层级id
     */
    @TableField("dir_path")
    private String dirPath;

    /**
     * 部门状态，0正常，1禁用
     */
    @TableField("state")
    @NotNull(message = "部门状态不能为空")
    private Integer state;

    /**
     * 部门管理员，关联Employee表id
     */
    @TableField("manager_id")
    private Long managerId;

    /**
     * 上级部门
     */
    @TableField("parent_id")
    private Long parentId;

    /**
     * 部门所属机构(租户)
     */
    @TableField("tenant_id")
    private Long tenantId;
}